﻿using BCEntity.IM.LeaveMessageRecord;
using System;
using System.Collections.Generic;
using System.Text;

namespace BCData.IM.LeaveMessageRecord
{
    /// <summary>
    /// 留言记录数据处理接口
    /// </summary>
    public interface ILeaveMessageRecordData
    {
        /// <summary>
        /// 检查留言信息是否已经记录过回复信息
        /// </summary>
        /// <param name="leaveMessageRecordId">留言记录Id</param>
        /// <returns></returns>
        bool CheckLeaveMessageAlreadyReplied(long leaveMessageRecordId);
        /// <summary>
        /// 添加留言记录
        /// </summary>
        /// <param name="leaveMessageRecordEntity">留言记录</param>
        /// <returns></returns>
        LeaveMessageRecordEntity Add(LeaveMessageRecordEntity leaveMessageRecordEntity);
        /// <summary>
        /// 更新回复信息
        /// </summary>
        /// <param name="leaveMessageRecordEntity">留言记录</param>
        /// <returns></returns>
        LeaveMessageRecordEntity UpdateReplyInfo(LeaveMessageRecordEntity leaveMessageRecordEntity);
        /// <summary>
        /// 更新留言为已读
        /// </summary>
        /// <param name="leaveMessageRecordId">留言记录Id</param>
        /// <returns></returns>
        LeaveMessageRecordEntity UpdateIsRead(long leaveMessageRecordId, long markAdminId, string markUserName);
        /// <summary>
        /// 获取留言记录
        /// </summary>
        /// <param name="leaveMessageRecordId">留言记录Id</param>
        /// <returns></returns>
        LeaveMessageRecordEntity Get(long leaveMessageRecordId);
        /// <summary>
        /// 获取留言列表
        /// </summary>
        /// <param name="isRead">是否已读</param>
        /// <param name="isReply">是否已回复</param>
        /// <param name="replyAdminName">回复管理员登录名称</param>
        /// <param name="start">开始时间</param>
        /// <param name="end">结束时间</param>
        /// <param name="ascending">排序</param>
        /// <param name="dataCount">数据总数</param>
        /// <param name="pageIndex">当前页码</param>
        /// <param name="pageSize">每页数据条数</param>
        /// <returns></returns>
        IEnumerable<LeaveMessageRecordEntity> Query(bool? isRead,bool? isReply,string replyAdminName, DateTime? start, DateTime? end, bool? ascending, out int dataCount, int pageIndex, int pageSize);
        /// <summary>
        /// 删除一段时间的留言记录
        /// </summary>
        /// <param name="start">开始时间</param>
        /// <param name="end">结束时间</param>
        void Delete(DateTime? start, DateTime? end);
        /// <summary>
        /// 客服今日统计
        /// </summary>
        /// <returns></returns>
        LeaveMessageCountEntity QueryCount();
    }
}
